<!DOCTYPE html SYSTEM "http://www.thymeleaf.org/dtd/xhtml1-strict-thymeleaf-spring3-3.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:th="http://www.thymeleaf.org">
    <head th:include="staff/template :: header" />
    <body class="main-body">
        <div class="container main-container">
            <div th:substituteby="staff/template :: nav" />   
            <a th:href="@{/staff/management/teacher/add}" class="btn btn-primary margin_button_bottom pull-right">Thêm Giáo Viên Mới</a>
            <div class="clearfix"></div>
            <table id="table" class="table_giaovien" style="word-wrap: break-word;">
                <thead>
                    <tr>
                        <th>Mã Giáo Viên</th>
                        <th>Họ Tên</th>
                        <th>Ngày Sinh</th>
                        <th>Giới Tính</th>
                        <th>Ngày Vào Làm</th>
                        <th>Ngày Nghỉ Việc</th>
                        <th>Địa Chỉ</th>
                        <th>Tác Vụ</th>
                    </tr>
                </thead>
                <tbody>
                    <tr th:id="${giaoVien.getid()}" align="center" th:each="giaoVien: ${listgiaoVien}">
                        <td th:text="${giaoVien.getmaGiaoVien()}" id="magiaoVien"/>
                        <td th:text="${giaoVien.gethoTen()}" id="hoTen"/>                        
                        <td th:text="${#dates.format(giaoVien.getngaySinh(),'dd/MM/yyyy')}" th:if="${giaoVien.getngaySinh()}" id="ngaySinh"/>
                        <td th:unless="${giaoVien.getngaySinh()}" id="ngaySinh"/>   
                        
                        <td th:text="${giaoVien.getgioiTinh()}==1?${'Nam'}:${'Nữ'}" id="gioiTinh"/>                        
                        <td th:text="${#dates.format(giaoVien.getngayVaoLam(),'dd/MM/yyyy')}" th:if="${giaoVien.getngayVaoLam()}" id="ngayVaoLam"/>
                        <td th:unless="${giaoVien.getngayVaoLam()}" id="ngayVaoLam"/>
                        <td th:text="${#dates.format(giaoVien.getngayNghiViec(),'dd/MM/yyyy')}" th:if="${giaoVien.getngayNghiViec()}" id="ngayNghiViec"/>
                        <td th:unless="${giaoVien.getngayNghiViec()}" id="ngayNghiViec"/>
                        <td th:text="${giaoVien.getdiaChi()}" id="diaChi"/>
                        <td>
                            <a th:href="@{'/staff/management/teacher/edit/'+${giaoVien.getmaGiaoVien()}}" title="SỬa"><i class="glyphicon glyphicon-pencil"></i></a>
                        </td>
                    </tr>
                </tbody>
            </table>
            <div th:include="staff/template :: footer"></div>
        </div>	
        <script th:inline="javascript">
            /*<![CDATA[*/
            jQuery(document).ready(function() {
                jQuery("#table").dataTable({"bJQueryUI": true});
                COMMON.activeMenu("nav_giaovien");
            });
            /*]]>*/
        </script>    
    </body>
</html>